import json


class Config:
    def __init__(self):
        self.__HELP_IMG = "./img/help.png"
        self.__BG_IMG = "./img/bg.png"
        self.__HOME1_IMG = "./img/home1.png"
        self.__HOME2_IMG = "./img/home2.png"
        self.__HOME3_IMG = "./img/home3.png"
        self.__HOME4_IMG = "./img/home4.png"
        self.__WIN_IMG = "./img/win.png"
        self.__THANKS_IMG = "./img/thanks.png"
        self.__GO_IMG = "./img/go.png"
        self.__BACK_IMG = "./img/back.png"

        self.__SCREEN_X = 600
        self.__SCREEN_Y = 600
        self.__UNIT = 30
        self.__FPS = 8
        self.__SNAKE_SIZE = 8
        self.__SNAKE_MAX_SIZE = 50
        self.__SNAKE_PUNISH_MAX_SIZE = 15
        self.__PUNISH_FLASH_COUNT = 4
        self.__MAP_DATA = self.load_stage()

    @property
    def HELP_IMG(self):
        return self.__HELP_IMG

    @property
    def BG_IMG(self):
        return self.__BG_IMG

    @property
    def HOME1_IMG(self):
        return self.__HOME1_IMG

    @property
    def HOME2_IMG(self):
        return self.__HOME2_IMG

    @property
    def HOME3_IMG(self):
        return self.__HOME3_IMG

    @property
    def HOME4_IMG(self):
        return self.__HOME4_IMG

    @property
    def WIN_IMG(self):
        return self.__WIN_IMG

    @property
    def THANKS_IMG(self):
        return self.__THANKS_IMG

    @property
    def BACK_IMG(self):
        return self.__BACK_IMG

    @property
    def GO_IMG(self):
        return self.__GO_IMG

    @property
    def SCREEN_X(self):
        return self.__SCREEN_X

    @property
    def SCREEN_Y(self):
        return self.__SCREEN_Y

    @property
    def UNIT(self):
        return self.__UNIT

    @property
    def MAP_DATA(self):
        return self.__MAP_DATA

    @property
    def FPS(self):
        return self.__FPS

    @property
    def SNAKE_SIZE(self):
        return self.__SNAKE_SIZE

    @property
    def SNAKE_MAX_SIZE(self):
        return self.__SNAKE_MAX_SIZE

    @property
    def SNAKE_PUNISH_MAX_SIZE(self):
        return self.__SNAKE_PUNISH_MAX_SIZE

    @property
    def PUNISH_FLASH_COUNT(self):
        return self.__PUNISH_FLASH_COUNT

    @staticmethod
    def load_stage():
        f = open("../stage.json", encoding='utf-8')
        return json.load(f)


config = Config()
